version 8.2
capture clear
capture log close
set more off
set mem 1000m
set mat 800

import excel using "p4v2015.xls", firstrow

keep if year==2010
keep country polity polity2
ren country countryname 

/*
autocracies	-10	-6
anocracies	-5	5
democracies	6	10
*/

gen Autocracy=1 if polity2>=-10&polity2<=-6
gen Anocracy=1 if polity2>=-5&polity2<=5
gen Democracy=1 if polity2>=6&polity2<=10


replace countryname="Bosnia and Herzegovina" if countryname=="Bosnia"
replace countryname="Cabo Verde" if countryname=="Cape Verde"
replace countryname="Congo, Dem. Rep." if countryname=="Congo Kinshasa"
replace countryname="Congo, Rep." if countryname=="Congo Brazzaville"
replace countryname="Cote d'Ivoire" if countryname=="Ivory Coast"
replace countryname="Egypt, Arab Rep." if countryname=="Egypt"
replace countryname="Gambia, The" if countryname=="Gambia"
replace countryname="Kyrgyz Republic" if countryname=="Kyrgyzstan"
replace countryname="Lao PDR" if countryname=="Laos"
replace countryname="Macedonia, FYR" if countryname=="Macedonia"
replace countryname="Micronesia, Fed. Sts." if countryname=="Micronesia"
replace countryname="Myanmar" if countryname=="Myanmar (Burma)"
replace countryname="Russian Federation" if countryname=="Russia"
replace countryname="Slovak Republic" if countryname=="Slovakia"
replace countryname="Venezuela, RB" if countryname=="Venezuela"


sort countryname 
save "Polity IV.dta", replace




exit
